//
//  NoDataView.swift
//  TianTianBiTing
//
//  Created by Gox mac 2 on 2018/12/29.
//  Copyright © 2018 Gox_WallyDiao. All rights reserved.
//

import UIKit

class NoDataView: UIView {
    var contentView:UIView!
    @IBOutlet weak var descImageView: UIImageView!
    @IBOutlet weak var descLabel: UILabel!
    
    override func layoutSubviews() {
        super.layoutSubviews()
        contentView = loadXib()
        addSubview(contentView)
    }
    
    override init(frame: CGRect) {
        super .init(frame: frame)
        contentView = loadXib()
        addSubview(contentView)
//        setUI()
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    func loadXib() ->UIView {
        let className = type(of:self)
        let bundle = Bundle(for:className)
        let name = NSStringFromClass(className).components(separatedBy: ".").last
        let nib = UINib(nibName: name!, bundle: bundle)
        let view = nib.instantiate(withOwner: self, options: nil).first as! UIView
        
        return view
    }

}
